﻿using UnityEngine;
using System.Collections;

public class TestHGmove : MonoBehaviour {

    private HgOffect hgOffect;
    public float HGspeed = 3f;
    //判断柱子是否移动
    private bool isZhuZi = false;
	void Start () {
        hgOffect = GetComponent<HgOffect>();
	}
	
	
	void Update () {
        if (transform.localPosition.x <= -0.25f)
        {
            transform.localPosition = new Vector3(0.78f, 1, 0);

            hgOffect.RangeHG();
        }
        if (isZhuZi)
        {
            transform.Translate(Vector3.left * Time.deltaTime * HGspeed, Space.Self);
        }
	}

    public void IsMoveZhu(bool IsOn)
    {
        isZhuZi = IsOn;
    }
}
